home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 352_01 / strppasn.cpp < prev    next >
C/C++ Source or Header  |  1991-04-29  |  493b  |  20 lines

  1. // STRPPASN.CPP
  2. //        String::assign ()  transfers ownership of data to the String
  3. //                ( allows constructing Strings from allocated buffers
  4. //                    ... without having to 'strdup' or make extra copies. )
  5. //
  6. #include "dblib.h"
  7.  
  8. void String::assign ( char *data )
  9.     {
  10.     typedef char *ASSIGN_DATA_PTR;
  11.     destruct ();
  12.     if ( data != NULL )
  13.         {
  14.         _NORMALIZE( data, ASSIGN_DATA_PTR );
  15.         s=data;
  16.         n=strlen (data);
  17.         }
  18.     }
  19.     
  20. //----------------- end of STRPPASS.CPP -----------------------